A router is usually designed to perform one or more basic networking tasks. One basic networking task is to police network traffic through the router. Policing ensures that admitted traffic that flows through the router adheres to an original contract of service between the network and the application.
Routers typically implement a leaky bucket controller that enforces compliance with flow descriptors. The leaky bucket controller generates token credits at a particular rate, which are deposited in a token bucket that holds a maximum number of tokens. When a packet in an incoming stream arrives at the router, the leaky bucket controller examines the length of the packet.
Typically one token is equivalent to one byte. Thus, in order for the transaction to comply, there must be enough tokens in the token bucket to process the entire length of the packet. The controller calculates whether the tokens in the token bucket are greater than the packet length. If so, a new token bucket is equal to the token bucket minus the packet length. Otherwise the packet is dropped. In order to calculate the above information, the controller calculates a token bucket for every clock tick, wherein the token bucket equals the token bucket plus the token rate. The token bucket typically cannot exceed a maximum size.
The problem with typical routers is that in new applications, a router can receive many million data flows per minute. Accordingly, the router needs to have sufficient circuit components (e.g., adders, multipliers, memory, etc.) to accommodate such flow. For instance, a vast amount of memory is required. Accordingly, several large memory devices are necessary to save all of the values used for the calculations.